//
//  GYX_SonData.m
//  MELive
//
//  Created by dllo on 16/10/20.
//  Copyright © 2016年 雅馨. All rights reserved.
//

#import "GYX_SonData.h"
#import "GYX_BannerCarousel.h"
#import "YYModel.h"
@implementation GYX_SonData

- (instancetype)initWithDictionary:(NSDictionary *)dictionary {
    self = [super initWithDictionary:dictionary];
    if (self) {
        NSDictionary *dicAll = @{@"bannerCarousel" :  NSStringFromClass([GYX_BannerCarousel class])};
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *dic in _data) {
            if (dicAll[_type]) {
                NSString *className = dicAll[_type];
                Class cls = NSClassFromString(className);
                BaseModel *model = [cls yy_modelWithJSON:dic];
                [array addObject:model];
            }
        }
        _data = array;
    }
    return self;
}
@end
